package com.mapproject.industrymap.controller;
import com.mapproject.industrymap.entity.ChildGeomEntity;
import com.mapproject.industrymap.service.FoodassetsChildInfoService;
import com.mapproject.industrymap.utils.ReturnValue;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.Map;

@RestController
@RequestMapping("/childinfo")
public class FoodassetsChildInfoController {
    @Autowired
    FoodassetsChildInfoService foodassetsChildInfoService;

    /**
     * 获取手绘几何及属性
     * @param type（1：国有资产房屋；2：私人建造房屋）
     * @param maps
     * @return
     */
    @RequestMapping(value = "/insertdata")
    public ReturnValue insertdata(@RequestParam(value = "type")String type, @RequestBody Map<String,Object> maps){
        ReturnValue result=foodassetsChildInfoService.insertdata(maps,type);
        return result;
    }

    /**
     * 查询小地块几何及数据
     * @param type （1：国有资产房屋；2：私人建造房屋，all：所有小地块但是没有具体属性）
     * @param rowguid （all：所有publicfoodassets_childgeom表几何；对应的rowguid即查询单独地块）
     * @return
     */
    @RequestMapping(value = "/querydata")
    public ReturnValue querydata(@RequestParam(value = "type")String type, @RequestParam(value ="rowguid")String rowguid){
        ReturnValue result=foodassetsChildInfoService.querydata(rowguid,type);
        return result;
    }
    @RequestMapping(value = "/updatedata")
    public ReturnValue queryonedata(@RequestBody Map<String,Object> maps,@RequestParam(value = "type")String type){
        ReturnValue result=foodassetsChildInfoService.updatedata(maps,type);
        return result;
    }
    @RequestMapping(value = "/getestatelist")
    public ReturnValue getestatelist(@RequestParam(value = "rowguid")String rowguid){
        ReturnValue result=foodassetsChildInfoService.getestatelist(rowguid);
        return result;
    }
}
